package Chuong08;
import java.net.*;


public class InetAddressTest {  
   public static void main(String[] args)    {  
      try  {
         String host = "Localhost";
         InetAddress[] addresses = InetAddress.getAllByName(host);
         System.out.println("Inet Address on "+ host + ":");
         for (InetAddress a : addresses)
               System.out.println("\t" + a);
         System.out.println("Inet Address on localhost:");
         InetAddress localHostAddress = InetAddress.getLocalHost();
         System.out.println(localHostAddress);
      }
      catch (Exception e)   {  
         e.printStackTrace();
      }
   }
}
